use Sample
GO

--query
Select * from tbl_Product
Select * from tbl_ProductSales

--view
Create view TotalSalesByProduct
With SchemaBinding
as
Select Name,
SUM(ISNULL((QuantitySold * UnitPrice),0)) as TotalSales,
COUNT_BIG(*) as TotalTransactions
from dbo.tbl_Product
join dbo.tbl_ProductSales
on dbo.tbl_Product.ProductID = dbo.tbl_ProductSales.ProductID
group by Name
GO

--clustered index
Create Unique Clustered Index IndTotalSalesByProductName
on TotalSalesByProduct(Name)